home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
et
/
et3_0-a1.lha
/
et3
/
src
/
Data.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-10
|
4KB
|
161 lines
#ifndef Data_First
#ifdef __GNUG__
//pragma once
#pragma interface
#endif
#define Data_First
#include "Object.h"
#include "Symbol.h"
#include "TypeMatcher.h"
class StreamBuf;
class MemBuf;
class Bitmap;
class SeqCollection;
class Converter;
//---- Data --------------------------------------------------------------------
class Data : public Object {
protected:
char *name;
Symbol creator, type;
bool isnew;
Class *classtype;
Converter *converter;
public:
MetaDef(Data);
Data(bool untitled= FALSE, char *name= 0);
~Data();
virtual char *FullName();
virtual char *ShortName();
char *Name()
{ return FullName(); }
Class *GetClassType()
{ return classtype; }
void SetClassType(Class *cl)
{ classtype= cl; }
virtual bool IsUntitled();
virtual Symbol Type();
virtual Symbol Creator();
virtual StreamBuf *GetStreamBuf();
StreamBuf *GetStreamBufForReading();
StreamBuf *GetStreamBufForWriting();
virtual bool IsWritable();
virtual bool IsReadable();
virtual bool IsExecutable();
virtual bool IsDirectory();
virtual bool IsETFormat();
virtual bool IsValid();
virtual bool IsCCode();
virtual bool IsAscii();
virtual long UniqueId();
virtual int SizeHint();
virtual Bitmap *GetBitmap();
virtual SeqCollection *GetContents();
virtual bool HasContents();
virtual Data *GetParent();
virtual long ModifiedAt();
virtual Object *AsObject(Class *want);
bool FindConvertersFor(Class *w1, Class *w2= 0, Class *w3= 0,
Class *w4= 0, Class *w5= 0);
virtual bool CanConvert(Class *want);
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
};
//---- FileData ----------------------------------------------------------------
class FileData : public Data {
protected:
long sizehint;
long modtime;
int uniqueid;
int isDeep;
bool lookDeep;
bool valid;
bool isETFormat;
bool isSystem;
bool isAscii;
bool isCCode;
bool isExec;
bool isDir;
void WhatType(bool deep= FALSE);
public:
MetaDef(FileData);
FileData(char *nm, bool untitled= FALSE, bool lookDeep= TRUE);
// lookDeep indicates that the contents of the file is
// considered for determining a file type
char *FullName();
char *ShortName();
char *GetLoadDir();
char *GetBaseName()
{ return ShortName(); }
char *PathName()
{ return FullName(); }
bool IsUntitled();
Symbol Type();
int SizeHint();
StreamBuf *GetStreamBuf();
long UniqueId();
Bitmap *GetBitmap();
bool IsWritable();
bool IsReadable();
bool IsExecutable();
bool IsETFormat();
bool IsCCode();
bool IsAscii();
bool IsDirectory();
bool IsValid();
long ModifiedAt();
Symbol Creator();
SeqCollection *GetContents();
bool HasContents();
Data *GetParent();
OStream& PrintOn(OStream&);
IStream& ReadFrom(IStream&);
};
//---- StreamBufData -----------------------------------------------------------
class StreamBufData : public Data {
public:
MetaDef(StreamBufData);
StreamBufData(StreamBuf *sb= 0, const Symbol &type= cDocTypeUndef);
void SetType(Symbol);
int SizeHint();
StreamBuf *GetStreamBuf();
protected:
StreamBuf *sb;
};
//---- ObjectData --------------------------------------------------------------
class ObjectData : public Data {
Object *object;
public:
MetaDef(ObjectData);
ObjectData(Object *op);
~ObjectData();
Object *AsObject(Class *want);
bool CanConvert(Class *want);
};
#endif